//
//  AccountTableViewCell.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/18.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "AccountTableViewCell.h"

@implementation AccountTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    WeakSelf
    self.titleLB = [UILabel labelWithText:@"线上商品支付交易" textColor:UIColorFromRGB(0x333333) fontSize:15];
    [_titleLB sizeToFit];
    [self addSubview:_titleLB];
    [_titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(rateWidth(30));
        make.top.equalTo(self).offset(rateHeight(25));
    }];
    self.detailLB = [UILabel labelWithText:@"管理员确认订单，增加锁定金额。\n管理员确认订单，增加锁定金额。" textColor:UIColorFromRGB(0x666666) fontSize:13];
    [_detailLB sizeToFit];
    _detailLB.numberOfLines = 0;
    [self addSubview:self.detailLB];
    [_detailLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(rateWidth(30));
        make.top.equalTo(weakSelf.titleLB.mas_bottom).offset(rateHeight(15));
        make.width.mas_lessThanOrEqualTo(@(rateWidth(570)));
        make.height.mas_lessThanOrEqualTo(@(rateHeight(100)));
    }];
    
    self.timeLB = [UILabel labelWithText:@"操作时间：2018-07-07 12:12" textColor:UIColorFromRGB(0x666666) fontSize:13];
    [_timeLB sizeToFit];
    [self addSubview:_timeLB];
    [_timeLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.titleLB);
        make.bottom.equalTo(self).offset(-rateHeight(25));
    }];
    
    self.moneyLB = [UILabel labelWithText:@"￥1.00" textColor:UIColorWhite fontSize:14 bgColor:navBarColor cornerRadius:4];
    [_moneyLB sizeToFit];
    [self addSubview:_moneyLB];
    [_moneyLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);         make.size.mas_offset(CGSizeMake(rateWidth(120), rateHeight(55)));
        make.right.equalTo(self).offset(-rateWidth(20));
    }];
    
    UIView *line = [[UIView alloc] init];
    line.backgroundColor = globalGray;
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.right.equalTo(self);
        make.height.equalTo(@(rateHeight(2)));
    }];
}

@end
